package com.xlh.server.protocol.support.json;

import android.content.Context;
import android.os.Handler;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;

import com.xlh.Utils.Constant;
import com.xlh.Utils.GsonManager;
import com.xlh.Utils.ProtocolParser;
import com.xlh.bean.CenterText;
import com.xlh.bean.ProtocolObject.Base;
import com.xlh.bean.ProtocolObject.Window;
import com.xlh.interf.IActivity;
import com.xlh.interf.ITakeMessage;
import com.xlh.thread.MessageBagerTask;

/**
 * Created by Administrator on 2018/7/2.
 */

public class LogindServer implements ITakeMessage {

    private IActivity atv;
    private String hasType = "logined";
    private Base protccoObj;
    public LogindServer(IActivity atv){
        this.atv = atv;


    }

    @Override
    public void takeMessage(String t,String s){

        if(!t.equals(this.hasType)) return;

        protccoObj =  GsonManager.gsmgr.jsonToAnyObject(s, Base.class);

        if(protccoObj==null ) return;

        //无论如何关闭注册角色的窗口和打开游戏主窗体
        this.atv.getActivity().gamescene.setVisibility(View.VISIBLE);
        this.atv.getActivity().fullsceneContainer.setVisibility(View.GONE);

    }

    @Override
    public boolean takeMessage(String s) {
        return false;
    }

    @Override
    public void init() {

    }

    @Override
    public void atViewLoadAfterInit(){



    }





}
